﻿# CMakeList.txt: 顶层 CMake 项目文件，在此处执行全局配置
# 并包含子项目。
#
cmake_minimum_required (VERSION 3.8)
set(CMAKE_CXX_STANDARD 17)

project ("CMakeProject")

# TODO: 如有需要，请添加测试并安装目标。

#SET(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "H:/boost_1_76_0/boost_1_76_0")
#SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "H:/boost_1_76_0/boost_1_76_0/stage/lib")
#FIND_PACKAGE(Boost)
#IF (Boost_FOUND)
#    INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
#    ADD_DEFINITIONS( "-DHAS_BOOST" )
#ENDIF()

#指定boost根目录
set(BOOST_ROOT H:/boost_1_76_0/boost_1_76_0)
#设置不适用系统的的boost的库
#set(BOOST_NO_SYSTEM_PATHS ON)
#设置使用静态的boost库
set(Boost_USE_STATIC_LIBS ON)
#查找boost库
find_package(Boost COMPONENTS thread system REQUIRED)

#如果已经找到
if(Boost_FOUND)
	MESSAGE( STATUS "Boost_INCLUDE_DIRS = ${Boost_INCLUDE_DIRS}.")
    MESSAGE( STATUS "Boost_LIBRARIES = ${Boost_LIBRARIES}.")
    MESSAGE( STATUS "Boost_LIB_VERSION = ${Boost_LIB_VERSION}.")
    MESSAGE( STATUS "Boost_LIBRARY_DIRS = ${Boost_LIBRARY_DIRS}.")
    include_directories(${Boost_INCLUDE_DIRS})
    link_directories(${Boost_LIBRARY_DIRS})

else()
    message(WARNING "boost not found.")
endif()


# 包含子项目。
add_subdirectory ("CMakeProject")

# 包含子项目。
add_subdirectory ("receiver")

# 包含子项目。
add_subdirectory ("sender")

